package com.java.base.exercise;

import org.springframework.format.annotation.DateTimeFormat;

/**
 * @Author:RenPu
 * @Date: 2020/11/3 14:38
 * @Version: 1.0
 * @description:
 */


public class People implements Comparable<People> {


    private String name;


    public  Integer age;

    public volatile int sex;




    public People(String name, Integer age) {
        super();
        this.name = name;
        this.age = age;
    }

    public People() {
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }

    public String test2(String port) {
        System.out.println("反射调用方法成功！！！！！");
        return "success!!!!" + port;
    }

    @Override
    public String toString() {
        return "People{" +
                "name='" + name + '\'' +
                ", age=" + age +
                ", sex=" + sex +
                '}';
    }

    public int getSex() {
        return sex;
    }

    public void setSex(int sex) {
        this.sex = sex;
    }

    @Override
    public int compareTo(People o) {
        return this.age.compareTo(o.getAge());
    }


}
